﻿

using System;
using UnityEngine;
namespace MrPP.SerriedCabinet
{
    [System.Serializable]
    public struct CabinetItem
    {

        [SerializeField]
        public Box.Data item;
        [SerializeField]
        public int position;
        [SerializeField]
        public int status;
        public float getPosition()
        {
            return item.channel * getLength();
        }

        public float getLength()
        {
            float len = Mathf.Clamp01((float)(position) / (float)(item.scale));
            if (item.type == 0)
            {
                return -len;
            }
            if (item.type == 1)
            {
                return len;
            }
            return 0;
        }
    }
   
}